package com.ushine.web.component.validation.annotation;

import com.ushine.web.component.validation.rule.GenderValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <h3>性别验证</h3>
 *
 * @Author: 邱鹏
 * @Date 2021-01-14 14:37
 * @CompileVersion 1.8
 * @Version 1.0
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = GenderValidator.class)
public @interface Gender {

    String message() default "性别只能为男或女";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
